{% for thread in threads %}
    {% set threadUrl = path('thread_view', {'slug': thread.slug}) %}
    <div class="media thread">
        <div class="media-left">
            <a href="{{ threadUrl }}">
                <img src="{{ asset(thread.cover|default('avatar/user1.jpg'))|imagine_filter('middle_square') }}" class="media-object avatar" role="avatar">
            </a>
        </div>
        <div class="media-body">
            <div class="media-heading title">
                <a href="{{ threadUrl }}">{{ thread.name }}</a>
            </div>
            <p>{{ thread.description }}</p>
            <ul class="list-unstyled list-inline meta">
                <li>话题数 {{ thread.topicCount|default(0) }}</li>
                <li>订阅数{{ thread.followerCount|default(0) }}</li>
            </ul>
        </div>
        <div class="media-right">
            <div data-role="follow-thread" data-slug="{{ thread.slug }}">
                {% if is_granted('IS_AUTHENTICATED_REMEMBERED') and thread.isFollowedBy(app.user) %}
                    <button class="btn btn-default" data-action="unfollow"><i class="if i-plus"></i> 已关注</button>
                {% else %}
                    <button class="btn u-btn-outline-primary" data-action="follow"><i class="if i-plus"></i> 关注</button>
                {% endif %}
            </div>
        </div>
    </div>
{% else %}
    <div class="empty-data">
        <i class="if i-comment"></i> 还没有节点
    </div>
{% endfor %}